<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        a{
            display:block;
        }
        #ad{
            width: 100%;
            height: 400px;
            background: rgb(93, 20, 161);
        }
        .mask{
            width: 100%;
            height: 100%;
            position:absolute;
            background: rgba(0,0,0,0.5);
            left: 0;
            top: 0;
        }

        button{
            position:absolute;
            left: 50px;
            top: 50px;
        }
    </style>
</head>

<body>
    <a href="http://www.atguigu.com">
        <div id="ad">
        </div>
    </a>

    <div class="mask">
        <button>点击关闭</button>
    </div>

    <script>
        let btn = document.querySelector("button");
        let mask = document.querySelector(".mask");

        btn.addEventListener('touchstart', function(e){
            //1. 阻止默认行为
            mask.style.display = 'none';
            //阻止默认行为
            e.preventDefault();
        })
    </script>
</body>

</html>